package com.peng.mybatis.builder;

import com.peng.mybatis.session.Configuration;
import com.peng.mybatis.type.TypeAliasRegistry;
import lombok.Getter;

@Getter
public abstract class BaseBuilder {

    protected final Configuration configuration;

    protected final TypeAliasRegistry typeAliasRegistry;

    protected BaseBuilder(Configuration configuration) {
        this.configuration = configuration;
        this.typeAliasRegistry = configuration.getTypeAliasRegistry();
    }

    protected Class<?> resolveAlias(String type) {
        return typeAliasRegistry.resolveAlias(type);
    }

}
